package demo4;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;

@SuppressWarnings({"all"})
public class Test {
    public static void main(String[] args) throws IOException {
        //1.创建对象
        Properties properties = new Properties();
        //2.读取这个目录下面的配置文件里面的内容
        properties.load(new FileReader("src\\demo4\\01.properties"));
        //3.打印到指定的设备上面
        properties.list(System.out);

        String str1=properties.getProperty("id");
        String str2=properties.getProperty("name");
        String str3=properties.getProperty("password");
        System.out.println("id的内容是："+str1);
        System.out.println("name的内容是："+str2);
        System.out.println("password的内容是："+str3);
    }
}
